//
//  BaseModel.m
//  BaseProject
//
//  Created by 孟瑞瑞 on 15/10/21.
//  Copyright © 2018年 CSDN. All rights reserved.
//

#import "BaseModel.h"
#import <YYModel/YYModel.h>

@implementation BaseModel

//MJCodingImplementation
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [self yy_modelEncodeWithCoder:aCoder];
}
- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init]; return [self yy_modelInitWithCoder:aDecoder];
}
- (id)copyWithZone:(NSZone *)zone
{
    return [self yy_modelCopy];
}
- (NSUInteger)hash
{
    return [self yy_modelHash];
}
- (BOOL)isEqual:(id)object
{
    return [self yy_modelIsEqual:object];
}
- (NSString *)description
{
    return [self yy_modelDescription];
}
- (void)setProduct_type:(NSString *)product_type{
    _product_type = product_type;
}
@end


@implementation CNFeedReportDataModel

- (void)setUrlParams:(NSDictionary *)urlParams{    
    NSMutableDictionary *data = [NSMutableDictionary dictionaryWithDictionary:urlParams];
    NSMutableDictionary *utmParams = [NSMutableDictionary dictionary];
    [urlParams.allKeys enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        if ([obj hasPrefix:@"utm_"]) {
            [utmParams setValue:urlParams[obj] forKey:obj];
            [data removeObjectForKey:obj];
        }
    }];
    _utm_source = utmParams;
    _urlParams = data;
}
@end
